#pragma once
#include "vv_log.h"
#include "spdlog/spdlog.h"
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/daily_file_sink.h"
#include "spdlog/sinks/rotating_file_sink.h"
#include "spdlog/sinks/stdout_sinks.h"
#include <stdarg.h>

class VVLog
{
public:
    VVLog(const char* log_path, const char* log_module, VV_LOG_LEVEL level);
    ~VVLog();

    void trace(const char* fmt, va_list args);
    void debug(const char* fmt, va_list args);
    void info(const char* fmt, va_list args);
    void warn(const char* fmt, va_list args);
    void error(const char* fmt, va_list args);
    void critical(const char* fmt, va_list args);

    void trace_s(const char* buf);
    void debug_s(const char* buf);
    void info_s(const char* buf);
    void warn_s(const char* buf);
    void error_s(const char* buf);
    void critical_s(const char* buf);

private:
    std::shared_ptr<spdlog::logger> m_logger;
    std::string m_log_module;
};
